import os

from celery import Celery

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meiduo.settings')

# 创建celery对象
app = Celery('celery_tasks', backend='redis://127.0.0.1:6379/3', broker='redis://localhost:6379/4')

# 设置broker
app.config_from_object("celery_tasks.config")

# celery 自动检测任务，这里会自动去celery_tasks.sms下找tasks.py
app.autodiscover_tasks(['celery_tasks.sms', 'celery_tasks.email'])